from django.contrib.auth.models import User
from django.db import models


SCALES = (
		  ('H', 'Huecos'),
		  ('Y', 'Yosemite Decimal System'),
		  )

VERMIN = (
		  ('', 'Choose A Rating'),
		  ('V0', 'V0'),
		  ('V1', 'V1'),
		  ('V2', 'V2'),
		  ('V3', 'V3'),
		  ('V4', 'V4'),
		  ('V5', 'V5'),
		  ('V6', 'V6'),
		  ('V7', 'V7'),
		  ('V8', 'V8'),
		  ('V9', 'V9'),
		  ('V10', 'V10'),
		  ('V11', 'V11'),
		  ('V12', 'V12'),
		  ('V13', 'V13'),
		  ('V14', 'V14'),
		  ('V15', 'V15'),
		  ('V16', 'V16'),
		  )

YDS = (
	   ('', 'Choose A Rating'),
	   ('5.0', '5.0'),
	   ('5.1', '5.1'),
	   ('5.2', '5.2'),
	   ('5.3', '5.3'),
	   ('5.4', '5.4'),
	   ('5.5', '5.5'),
	   ('5.6', '5.6'),
	   ('5.7', '5.7'),
	   ('5.8', '5.8'),
	   ('5.9', '5.9'),
	   ('5.10a', '5.10a'),
	   ('5.10b', '5.10b'),
	   ('5.10c', '5.10c'),
	   ('5.10d', '5.10d'),
	   ('5.11a', '5.11a'),
	   ('5.11b', '5.11b'),
	   ('5.11c', '5.11c'),
	   ('5.11d', '5.11d'),
	   ('5.12a', '5.12a'),
	   ('5.12b', '5.12b'),
	   ('5.12c', '5.12c'),
	   ('5.12d', '5.12d'),
	   ('5.13a', '5.13a'),
	   ('5.13b', '5.13b'),
	   ('5.13c', '5.13c'),
	   ('5.13d', '5.13d'),
	   ('5.14a', '5.14a'),
	   ('5.14b', '5.14b'),
	   ('5.14c', '5.14c'),
	   ('5.14d', '5.14d'),
	   ('5.15a', '5.15a'),
	   ('5.15b', '5.15b'),
	   ('5.15c', '5.15c'),
	   ('5.15d', '5.15d'),
	   )

class Region(models.Model):
	name = models.CharField(max_length=100)
	type = models.CharField(max_length=1, choices=SCALES)

class Quota(models.Model):
	region = models.ForeignKey(Region)
	rating = models.CharField(max_length=5)
	number = models.IntegerField()

class Route(models.Model):
	region = models.ForeignKey(Region)
	name = models.CharField(blank=True, default= '', max_length=100)
	number = models.CharField(null=True, blank=True,max_length=100)
	color = models.CharField(max_length=100)
	rating = models.CharField(max_length=5)
	image = models.ImageField(upload_to="route_images/", default='')
	description = models.TextField(blank=True, default='')
	active = models.BooleanField(default=True)
	setter = models.ForeignKey(User)
	date_set = models.DateTimeField(auto_now_add=True)

class Evaluation(models.Model):
	user = models.ForeignKey(User)
	route = models.ForeignKey(Route)
	overall = models.IntegerField()
	consistent = models.IntegerField()
	fair = models.IntegerField()
	variety = models.IntegerField()
	creative = models.IntegerField()
	flows = models.IntegerField()
	accessible = models.IntegerField()
	enjoyable = models.IntegerField()
	suggested_rating = models.CharField(max_length=5)
	comments = models.TextField(blank=True, default='')
	timestamp = models.DateTimeField(auto_now_add=True)

class Setter(models.Model):
	user = models.ForeignKey(User, unique=True)